package com.ostrich.a2104gao5.test23

/**
 * @Author : yaotianxue
 * @Time : On 2023/10/17 13:27
 * @Description : IReturn
 *
 * out:协变只能作为返回值
 */
interface IReturn<out T>{
    fun effect():T
}

//父类
open class Fruit()
//子类
class Apple():Fruit()


//生产者
class FruitMarket:IReturn<Fruit>{
    override fun effect(): Fruit {
        println("FruitMarket effect")
        return Fruit()
    }
}

fun main(){

}
